#include <stdio.h>
 
int main()
{
    int m = 0;
    int n = 0;
    scanf("%d %d", &m, &n);
    int set = 0;
    while (set = m % n)
    {
        m = n;
        n = set;
    }
    printf("最大公约数为:%d\n", n);
    return 0;
}